using System;
using System.Collections.Generic;
using System.Text;

namespace Developex.DatabaseWrapper.Fields
{
	/// <summary>
	/// Standard int primary key
	/// </summary>
	public class IntPrimaryKey : Field<int>
	{
		#region Constructors

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="name"></param>
		public IntPrimaryKey(string name)
			: base(name, FieldFlags.PrimaryKey | FieldFlags.Identity)
		{
		}

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="name"></param>
		/// <param name="flags"></param>
		public IntPrimaryKey(string name, FieldFlags flags)
			: base(name, flags | FieldFlags.PrimaryKey | FieldFlags.Identity)
		{
		}

		#endregion

		#region Overrides

		///<summary>
		/// Create object 
		///</summary>
		///<returns></returns>
		/// <remarks>
		/// Here should be only object creation, all data copy should be in overrided Clone function.
		/// Used only in base version of Clone function.
		/// Should be overrided for ICloneable interface.
		/// </remarks>
		protected override Field<int> CreateObjectForClone()
		{
			return new IntPrimaryKey(null);
		}

		#endregion
	}
}
